﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Meraz.Core.Model
{
    public class Link
    {
        public int ID { get; set; }
        public Post Post { get; set; }
        public virtual Url Url { get; set; }
        public string Tone
        {
            get { return this.ToneType.ToString(); }
            set {
                if (string.IsNullOrWhiteSpace(value))
                    this.ToneType = ToneType.Undefined;
                else
                {
                    try
                    {
                        this.ToneType = (ToneType)Enum.Parse(typeof(ToneType), value);
                    }
                    catch
                    {
                        this.ToneType = ToneType.Undefined;
                    }
                }
            }
        }
        public ToneType ToneType { get; set; }
        public int PostID { get; set; }
        public int UrlID { get; set; }
    }
}
